#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_pushButton_enabled_clicked()
{
    //判断按钮的状态
    bool statu = ui->pushButton->isEnabled();
    if(statu)
    {
        //设为禁用
        ui->pushButton->setEnabled(false);
    }
    else{
        ui->pushButton->setEnabled(true);
    }
}

void Widget::on_pushButton_clicked()
{
    //查看该按钮是否可以点击
    qDebug() << "按下该按钮";
}
